define(() => {
    return function (id, res) {
        let i = 0;
        const flag = res.some((val, idx) => {
            i = idx;
            return val.proId === id
        })
        if (flag) {
            $(".goods_datail").children("h3").html(res[i].proName)
            $(".goods_datail").children(".goods_datail_3").children(".price").children(".price_1").children("strong").html(res[i].price)

            //s图片
            let arr = [];
            for (var j in res[i].img_s) {
                arr.push(res[i].img_s[j])
            }
            // console.log(arr)
            let str = ""
            arr.forEach(val => {
                str += `
                <img src="${val}" alt="">
                `
            })
            $(".imgbox").html(str)
            //m图
            let arr1 = [];
            for (var j in res[i].img_m) {
                arr1.push(res[i].img_m[j])
            }
            console.log(arr1)
            let str1 = ""
            arr1.forEach(val => {
                str1 += `
                <div class="item">
                <img src="${val}" alt="">
                <span></span>
                <em></em>
                </div>
                `
            })
            $(".box1").children(".cont").html(str1)
            //l图
            let arr2 = [];
            for (var j in res[i].img_l) {
                arr2.push(res[i].img_l[j])
            }
            console.log(arr2)
            let str2 = ""
            arr2.forEach(val => {
                str2 += `
                        <div class="l_box">
                        <img src="${val}" alt="">
                        </div>
                        `
            })
            $(".l_box_bgbox").html(str2)
            const num = document.querySelector("table thead tr th:nth-child(1) i strong")
            num.innerHTML = (res[i].num)

            $(".goods_datail_6").children(".p7").children("span").html(res[i].remain)

            //数字框渲染
            $(".goods_datail_6_number").html('')
            new InputNumber({
                min: 1,
                max: res[i].remain,
                value: 1,
                cont: document.querySelector(".goods_datail_6_number")
            })

        }
    }
});